package com.atguigu.srb.base.exception;

import com.atguigu.srb.base.result.ResponseEnum;
import lombok.Getter;
import lombok.ToString;

@Getter
@ToString
public class SrbBussinessException extends RuntimeException {
    //携带异常描述信息
    private Integer code;
    private String msg;
    public SrbBussinessException(Integer code, String msg) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }
    public SrbBussinessException(ResponseEnum responseEnum) {
        super(responseEnum.getMessage());
        this.code = responseEnum.getCode();
        this.msg = responseEnum.getMessage();
    }

}
